import React, { Component } from 'react'
import { Text, View,TextInput,Image } from 'react-native'
import {get} from '../../utils/http'

import {Wrap,City} from './styled'
const search=require("../../assets/image/search.png")
interface Props {

}

interface State {
  list: Array<object>,
  text:String
}
export default class Search extends Component<Props, State>  {
    state = {
        list: [],
        text:''
      }
   
  async  componentDidMount(){
        let list1= await get('https://m.lagou.com/search.json?city=全国&positionName=前端&pageNo=1&pageSize=15')
        let list=list1.content.data.page.result
        this.setState({
         list
        })
    }
    input=async (text)=>{
        // let list1= await get(`https://m.lagou.com/search.json?city=全国&positionName=${text}&pageNo=1&pageSize=15`)
        // let list=list1.content.data.page.result
        // this.setState({
        //  list
        // })
    }
    render() {
        return (
            <>
            <Wrap>
                <City>
                   <Text> 全国</Text>  
                </City>
           <TextInput 
           style={{ height: 45,width:"100%", borderColor: 'gray', borderWidth: 1  }}
           onChangeText={(text)=>{this.input(text)}}
           ></TextInput>  
            </Wrap>
            <View>
       {
           this.state.list.map((value,index)=>{
               return(
                   <Text>666</Text>
               )
           })
       }

            </View>
            </>
        )
    }
}
